import request from "@/api/request";
import { type AxiosRequestConfig } from "axios";
import { type DeepRequired } from "../../interface";

/**
 * /paymentTicket/add
 */
export function postPaymentTicketAdd(params: PostPaymentTicketAddParams, input?: PostPaymentTicketAddInput, config?: AxiosRequestConfig) {
    const paramsInput = {
        name: params.name,
        title: params.title,
        type: params.type,
        amount: params.amount,
        contractId: params.contractId,
    };
    return request.post<DeepRequired<any>>(`/paymentTicket/add`, input, {
        params: paramsInput,
        ...config,
    });
}

export interface PostPaymentTicketAddParams {
    name?: string;
    title?: string;
    type?: string;
    amount?: string;
    contractId?: number;
}

export interface PostPaymentTicketAddInput {
    file: File;
}
